package jvm;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 真香
 * @create 2021-08-18 0:25
 */
public class OOM {

    // 1M
    //byte[]  array = new byte[1*1024*1024];

    public static void main(String[] args){
        byte[]  array = new byte[1*1024*1024];
        int count = 0;
        try {
            List<byte[]> list = new ArrayList<>();
            while (true) {
                list.add(array);
                count++;
            }
        } catch (Exception e) {
            System.out.println("count="+count);
            e.printStackTrace();
        }


    }

}
